﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace PersistentObject.Common.Attributes
{
    /// <summary>
    /// Identify whether a property value in a database can be accessed or not.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class DbAccessAttribute : Attribute
    {
        /// <summary>
        /// The constructor of a DbAccess attribute which sets the Load and Save to be true by default
        /// </summary>
        public DbAccessAttribute()
        {
            Load = true;
            Save = true;
        }

        /// <summary>
        /// Identify whether the data should be loaded from a database or not.
        /// </summary>
        public bool Load { get; set; }
        /// <summary>
        /// Identify whether the data should be saved into a database or not.
        /// </summary>
        public bool Save { get; set; }
    }
}
